
import Addresses from './components/addresses.vue'
import Invoice from './components/invoice.vue'


require('./app')({
  'addresses': Addresses,
  'invoice': Invoice
}, function() {
  $('.address-row').on('click', '.address-item', function() {
    $(this).addClass('active').siblings().removeClass('active');
    $('#input_address_id').val($(this).attr('id'))
  })

  $('#order_form').submit(function(e){
    if ($('#input_address_id').val() === '') {
      e.preventDefault();
      confirm('请选择或添加地址！')
    }
    if ($('#input_invoice_id').val() === '') {
      e.preventDefault();
      confirm('请选择或添加发票！')
    }
  });
})
